package com.xhiji.test.singletion;

/**
 * 懒加载模式
 */
public class Singletion {

    private volatile static Singletion singletion;

    private Singletion(){}

    public static Singletion getInstance(){
        if (singletion == null){
            synchronized (Singletion.class){
                if(singletion == null){
                    singletion = new Singletion();
                }
            }
        }
        return singletion;
    }
}
